# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Jan de Groot <jgc@archlinux.org>

pkgname=libgweather
pkgver=40.0+r87+g80e5a652
pkgrel=2
pkgdesc="Location and timezone database and weather-lookup library"
url="https://wiki.gnome.org/Projects/LibGWeather"
arch=(x86_64)
license=(LGPL)
depends=(libsoup gtk3 geocode-glib dconf)
makedepends=(gobject-introspection vala git gtk-doc glade meson python-gobject)
checkdepends=(python-pylint)
_commit=80e5a652405a7c492b252c5196460caa0b05793d  # libgweather-3
source=("git+https://gitlab.gnome.org/GNOME/libgweather.git#commit=$_commit"
        disable-metar-test.diff)
sha256sums=('SKIP'
            'f64afeebdca41198e16a040379e2d6f02ef07784d5ef4d15df381d2c065f588a')

pkgver() {
  cd libgweather
  git describe --tags | sed 's/[^-]*-g/r&/;s/-/+/g'
}

prepare() {
  cd libgweather

  # Avoid test failure without fr_FR.UTF-8 locale
  git cherry-pick -n 237addd5c02f70c654b69f6697c502590594ae20

  # Disable metar test, depends on unstable online service
  git apply -3 ../disable-metar-test.diff
}

build() {
  arch-meson libgweather build -D gtk_doc=true
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs
}

package() {
  provides=(libgweather-3.so)

  meson install -C build --destdir "$pkgdir"
}

# vim:set sw=2 et:
